﻿using System;
using System.Windows.Forms;

namespace ShopHelper.BLL
{
    public abstract class ItemHtmlElement
    {
        #region "字段"

        protected HtmlElement htmlElement;

        #endregion

        public ItemHtmlElement(HtmlElement htmlElement) 
        {
            this.htmlElement = htmlElement;
        }

        /// <summary>
        /// 判断指定的Html元素是否是商品元素
        /// </summary>
        /// <returns></returns>
        public abstract Boolean IsGoodElement();

        /// <summary>
        /// 分析右键选中的html元素，得出基本的商品url信息
        /// </summary>
        /// <param name="itemTitle">商品的标题</param>
        /// <param name="from">商品的来源（天猫、淘宝、阿里巴巴、拍拍等等）</param>
        /// <param name="itemUrl"></param>
        /// <param name="itemID"></param>
        /// <returns></returns>
        public abstract Boolean ParseHtmlElement(out String itemTitle, out String from, out String itemUrl, out String itemID);
    }
}
